const mysql = require('mysql2');
module.exports = (req, res, next) => {
    const conn = mysql.createConnection({
        host: '127.0.0.1',//主机
        port: '3306',//端口
        user: 'root',//用户
        database: 'info'//数据库
    })
    req.db = conn.promise()
    next()
}